package demo1209.pm2;

import java.util.Random;
import java.util.Scanner;

public class Demo_01 {
    public static void main(String[] args) {
        Z a = new Z(1, 2);
        System.out.println(a.num);//2
        a.showfu();
        a.showzi();
        System.out.println(a);

    }
}

class F {
    int num;

    public F(int num) {
        this.num = num;
    }

    public void showfu() {
        System.out.println("父类中的方法");

    }
}

class Z extends F    {
    int num;

    public Z(int a, int b) {
        super(a);
        this.num = b;
    }

    public void showzi() {
        System.out.println("子类中的方法");
        System.out.println(this);
    }

}